package cn.xyh.service;


import cn.xyh.exception.UserException;
import cn.xyh.model.User;

import java.util.List;

public interface IUserService  {

    /**
     * 新增
     */
    public boolean insertUser(User entity) throws UserException;

    /**
     * 删除多个
     */
    public Integer delUserByIds(String primaryKey) throws UserException;

    /**
     * 删除
     */
    public Integer delUser(long id) throws UserException;

    /**
     * 修改
     */
    public Integer updateUser(User entity) throws UserException;

    /**
     * 根据ID查找对象
     */
    public User getUserById(long userId) throws UserException;

    /**
     * 根据Code查找对象
     */
    public User getUserByCode(String code) throws UserException;

    /**
     * 根据名称查找对象
     */
    public User getUserByName(String name) throws UserException;

    /**
     * 根据条件查找列表总数
     */
    public Integer getUserCount(User entity) throws UserException;

    /**
     * 根据条件查找列表
     *
     * @param entity      实体对象
     * @param startRownum 开始条数
     * @param endRownum   结束条数
     * @param sortField   排序字段
     * @param sortOrder   正序/倒序
     */
    public List<User> getUserList(User entity) throws UserException;

}

